Elementary 1D Cellular Automata

I recently read the book A New Kind of Science from Stephen Wolfram, which intrigued me to try it out with python. Stephen Wolfram establishes the notion that high complexity arises out of very simplistic rules, contrary to common perception that to create highly complex systems you need very complex set of rules. He often points out to the nature, how we see extremely complex systems, patterns, structures in nature. However they are based on very simple rules.

Cellular automata are discrete dynamical systems evolving on a grid of cells. These cells can be in a finite number of states (for example, on/off). The evolution of a cellular automaton is governed by a set of rules, describing how the state of a cell changes according to the state of its neighbors.

Although extremely simple, these models can initiate highly complex and chaotic behaviors. Cellular automata can model real-world phenomena such as car traffic, chemical reactions, propagation of fire in a forest, epidemic propagations, and much more. Cellular automata are also found in nature. For example, the patterns of some seashells are generated by natural cellular automata.

Elementary States

You can see the visualization of 8 elmentary states below. The cell will either be 1 or 0 based on its three neighbours on top in previous iteration.

based on 8 states we can create total of 256 different rules based on binary representation. You can see more details here: https://www.youtube.com/watch?v=M_pkidxeGMY

Above, I created a list of dictionaries to hold all the rules, Lets see the representation of famous rule 30

Simulation of Famous Rule 30 upto 100 evolutions

Based on this rule, lets create the 100 evolutions of this rule startin with only 1 bit on in the center

Lets see the initial state of our grid:

Here are the simulations of rule 30 upto 100 rows, based on above shown inital state

Simulation of all 256 Rules

now, lets see the simulation of all 256 rules based on same initial condition provided

Simlutation of All 256 rules based on random initial States

we see alot of rules which did not evolve and died out, while some produced greate complexity or nested behaviours. Lets see the behaviour of same rules based on random initial conditions

most of the rules which showed no progress with first initial condition tend to show the same behaviour even with the randomized initial conditions

Whats Next:

It is interesting to see how such basic and simple rules create such chaotic behaviours. Some of the applications of cellular automata are in random number generation, Simulation of waves and particles etc. It would be interesting to try out conways game of life.